#include<reg52.h>
#define uint unsigned int 
#define uchar unsigned char
sbit d1=P1^0;
uchar num;
uchar code table[]={
0xc0,0xf9,0xa4,0xb0,
0x99,0x92,0x82,0xf8,
0x80,0x90,0x88,0x83,
0xc6,0xa1,0x86,0x8e,
0xc2,0x89};
void delay(uint z);
void main()
{
	EA=1;
	EX0=1;
	while(1)
	{
		for(num=0;num<18;num++)
			{
				P2=0x0f;
				P0=table[num];
				delay(1000);	
			}
	}
}

void delay(uint z)
{
	uint x,y;
	for(x=z;x>0;x--)
		for(y=220;y>0;y--);	
}

void exter0() interrupt 0
{
	d1=0;
}